#ifndef __STUMANAGESYSTEM_H
#define __STUMANAGESYSTEM_H

#include "screen.h"
#include "student.h"
#include "teacher.h"
#include "root.h"

#define PASSWD_INPUT_CNT        3
#define WRITE_FLAG              (0x11223344)
#define WRITE_FLAG_SZIE         4

typedef enum AccountType{
    ROOTACCOUNT = 1,
    TEAACCOUNT,
    STUACCOUNT,
    ERRORTYPE
}AccountType;

typedef struct PeoManage{
    StuManage stuManage;
    TeaManage teaManage;
}PeoManage;

//界面
#define LOGIN                   1

//root
#define ROOT_SHOWALL            1

//学生
#define STU_SHOWMYMESSAGE       1
#define STU_CHANGEMYMESSAGE     2
#define STU_SHOWALLSCORE        3
#define STU_SORTBYID            4
#define STU_SORTBYSCORE         5

//老师
#define TEA_SHOWMYMESSAGE       1
#define TEA_CHANGEMYMESSAGE     2
#define TEA_SHOWALLTEAMESSAGE   3
#define TEA_SORTTEABYID         4
#define TEA_SHOWALLSTUMESSAGE   5
#define TEA_ADDSTU              6
#define TEA_CHANGESTUMESSAGE    7
#define TEA_CHANGESTUSCORE      8
#define TEAT_DELSTU             9
#define TEA_SORTALLSTUBYID      10
#define TEA_SORTALLSTUBYSCORE   11

//root
#define ROOT_SHOWALLMESSAGE     1

#define EXIT            0

void ManageSysShowLogin();
void ManageSysLogin(PeoManage* peoManage,AccountType* accountType,int* id,int* index);
status ManageSysInit(PeoManage* peoManage);
status ManageSysWriteDate(PeoManage* peoManage);
status ManageSysReadDate(PeoManage* peoManage,int* writeFlag);

//root
void ManageSysShowMenuRoot();
void ManageSysShowAllMessage(PeoManage* peoManage);

//学生
void ManageSysShowMenuStu();
void ManageSysShowMyMessageStu(PeoManage* peoManage,int id);
status ManageSysChangeMyMessageStu(PeoManage* peoManage,int id);
void ManageSysShowAllScoreStu(PeoManage* peoManage);

//老师
void ManageSysShowMenuTea();
void ManageSysShowMyMessageTea(PeoManage* peoManage,int id);
status ManageSysChangeMyMessageTea(PeoManage* PeoManage,int id);
void ManageSysShowAllTeaMessageTea(PeoManage* peoManage);
void ManageSysSortTeaByIdTea(PeoManage* peoManage);
void ManageSysShowAllStuMessageTea(PeoManage* peoManage);
status ManageSysAddStuTea(PeoManage* peoManage);
void ManageSysChangeStuMessageTea(PeoManage* peoManage);
void ManageSysChangeStuScoreTea(PeoManage* peoManage);
void ManageSysDelStuTea(PeoManage* peoManage);

//学生老师
status ManageSysSortStuById(PeoManage* peoManage);
status ManageSysSortStuByScore(PeoManage* peoManage);

#endif
